package com.bandit.controller.front;

import com.bandit.pojo.Lab;
import com.bandit.service.LabService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/front")
public class LabFrontController {

    private static final String prefix = "front";

    @Autowired
    LabService labService;

    @GetMapping("/lab/list")
    public String labList(Model model){
        List<Lab> labList = labService.selectLabList(new Lab());
        model.addAttribute("labList",labList);
        return prefix + "/labs";
    }

}
